/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cmp.screens;

import com.jme3.app.Application;
import com.jme3.app.state.AppStateManager;

/**
 * The screen that plays some fancy movies and what not.
 * @author krummer
 */
public class StartScreen extends ScreenAppController {
    
    /** how long the screen is displayed before it changes */
    private static final float DISPLAY_DURATION = 5.f;
    private float displayedTime;

    @Override
    public void initialize(AppStateManager stateManager, Application app) {
       super.initialize(stateManager, app);
       
       this.displayedTime = DISPLAY_DURATION;    
    }
    
    
    @Override
    public void update(float tpf) {
        this.displayedTime -= tpf;
        if(this.displayedTime < 0.f) {
            this.getNifty().gotoScreen("mainMenu");
        }
    }

    @Override
    public void onStartScreen() {
        //do nothing, otherwise the application will crash.
    }
}
